import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by dell on 2017/8/7.
 */
public class FileInputStreamTest {
    public static void main(String[] args) throws IOException {
        FileInputStream file = new FileInputStream("F:\\IdeaProjects\\IO\\src\\FileInputStreamTest.java");
        FileOutputStream fos = new FileOutputStream("F:\\IdeaProjects\\IO\\src\\newFile.txt");
        byte[] bytes = new byte[1024];
        int hasRead = 0;
        while ((hasRead = file.read(bytes)) > 0) {
            //System.out.println(new String(bytes,0,hasRead));
            fos.write(bytes, 0, hasRead);

        }
        file.close();
    }
}
